using CodeSaude.Domain.Entities;
using System.Data.Entity.ModelConfiguration;

namespace CodeSaude.Infrastructure.Data.EntityConfig
{
    public class ExameMap : EntityTypeConfiguration<Exame>
    {
        public ExameMap()
        {
            // Primary Key
            this.HasKey(t => t.ExameId);

            // Properties
            this.Property(t => t.NomeExame)
                .HasMaxLength(90);

            this.Property(t => t.CodigoSus)
                .HasMaxLength(13);

            // Table & Column Mappings
            this.ToTable("exame");
            this.Property(t => t.ExameId).HasColumnName("id_exame");
            this.Property(t => t.NomeExame).HasColumnName("nome_exame");
            this.Property(t => t.IdCategoria).HasColumnName("id_categoria");
            this.Property(t => t.IdSituacao).HasColumnName("id_situacao");
            this.Property(t => t.CodigoSus).HasColumnName("codigo_sus");
        }
    }
}
